﻿<Window x:Class="DynaCAD.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="DynaCAD" Opacity="1" WindowStyle="SingleBorderWindow" BorderBrush="#00000000" WindowStartupLocation="CenterScreen" WindowState="Maximized" Height="1024" Width="1280" KeyDown="WindowKeyDown" Icon="dc.ico">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVisConverter" />
        <!-- Normal border brush for flat button -->
        <SolidColorBrush x:Key="FlatButtonNormalBorder"
                   Color="#FF707070" />
        <!-- Hover background for flat button -->
        <SolidColorBrush x:Key="FlatButtonHoverBackgroundBrush"
                   Color="#FFC5E4FC" />

        <!-- Hover border brush for flat button -->
        <SolidColorBrush x:Key="FlatButtonHoverBorderBrush"
                   Color="#FFA5BCF8" />

        <!-- Disabled text color for flat button -->
        <SolidColorBrush x:Key="FlatButtonDisabledForegroundBrush"
                   Color="#ADADAD" />
        <LinearGradientBrush x:Key="ToolBarHorizontalBackground" EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="#FFFFFF" Offset="0"/>
            <GradientStop Color="#FFFBFF" Offset="0.5"/>
            <GradientStop Color="#F7F7F7" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ToolBarToggleButtonVerticalBackground" EndPoint="1,0" StartPoint="0,0">
            <GradientStop Color="#ECECEC" Offset="0"/>
            <GradientStop Color="#DDDDDD" Offset="0.5"/>
            <GradientStop Color="#A0A0A0" Offset="1"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="ToolBarButtonHover" Color="#C2E0FF"/>
        <SolidColorBrush x:Key="ToolBarGripper" Color="#C6C3C6"/>
        <Style x:Key="ToolBarVerticalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
            <Setter Property="Background" Value="{StaticResource ToolBarToggleButtonVerticalBackground}"/>
            <Setter Property="MinHeight" Value="0"/>
            <Setter Property="MinWidth" Value="0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}" CornerRadius="0,0,3,3" SnapsToDevicePixels="true">
                            <Canvas HorizontalAlignment="Right" Height="6" Margin="2,7,2,2" SnapsToDevicePixels="true" VerticalAlignment="Bottom" Width="7">
                                <Path Data="M 1.5 1 L 1.5 6" Stroke="White"/>
                                <Path Data="M 0.5 0 L 0.5 5" Stroke="{TemplateBinding Foreground}"/>
                                <Path Data="M 3.5 0.5 L 7 3.5 L 4 6.5 Z" Fill="White"/>
                                <Path Data="M 3 -0.5 L 6 2.5 L 3 5.5 Z" Fill="{TemplateBinding Foreground}"/>
                            </Canvas>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource ToolBarGripper}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
                    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <LinearGradientBrush x:Key="ToolBarVerticalBackground" EndPoint="1,0" StartPoint="0,0">
            <GradientStop Color="#FFFFFF" Offset="0"/>
            <GradientStop Color="#FFFBFF" Offset="0.5"/>
            <GradientStop Color="#F7F7F7" Offset="1"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ToolBarToggleButtonHorizontalBackground" EndPoint="0,1" StartPoint="0,0">
            <GradientStop Color="#ECECEC" Offset="0"/>
            <GradientStop Color="#DDDDDD" Offset="0.5"/>
            <GradientStop Color="#A0A0A0" Offset="1"/>
        </LinearGradientBrush>
        <Style x:Key="ToolBarHorizontalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
            <Setter Property="Background" Value="{StaticResource ToolBarToggleButtonHorizontalBackground}"/>
            <Setter Property="MinHeight" Value="0"/>
            <Setter Property="MinWidth" Value="0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}" CornerRadius="0,3,3,0" SnapsToDevicePixels="true">
                            <Canvas HorizontalAlignment="Right" Height="7" Margin="7,2,2,2" SnapsToDevicePixels="true" VerticalAlignment="Bottom" Width="6">
                                <Path Data="M 1 1.5 L 6 1.5" Stroke="White"/>
                                <Path Data="M 0 0.5 L 5 0.5" Stroke="{TemplateBinding Foreground}"/>
                                <Path Data="M 0.5 4 L 6.5 4 L 3.5 7 Z" Fill="White"/>
                                <Path Data="M -0.5 3 L 5.5 3 L 2.5 6 Z" Fill="{TemplateBinding Foreground}"/>
                            </Canvas>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="true">
                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{StaticResource ToolBarGripper}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
                    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <SolidColorBrush x:Key="ToolBarMenuBorder" Color="#808080"/>
        <SolidColorBrush x:Key="ToolBarSubMenuBackground" Color="#FDFDFD"/>
        <Style x:Key="ToolBarThumbStyle" TargetType="{x:Type Thumb}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Border Background="Transparent" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
                            <Rectangle>
                                <Rectangle.Fill>
                                    <DrawingBrush TileMode="Tile" Viewbox="0,0,4,4" Viewport="0,0,4,4" ViewportUnits="Absolute" ViewboxUnits="Absolute">
                                        <DrawingBrush.Drawing>
                                            <DrawingGroup>
                                                <GeometryDrawing Brush="White" Geometry="M 1 1 L 1 3 L 3 3 L 3 1 z"/>
                                                <GeometryDrawing Brush="{StaticResource ToolBarGripper}" Geometry="M 0 0 L 0 2 L 2 2 L 2 0 z"/>
                                            </DrawingGroup>
                                        </DrawingBrush.Drawing>
                                    </DrawingBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Cursor" Value="SizeAll"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ToolBarMainPanelBorderStyle" TargetType="{x:Type Border}">
            <Setter Property="Margin" Value="0,0,11,0"/>
            <Setter Property="CornerRadius" Value="3,3,3,3"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
                    <Setter Property="CornerRadius" Value="0,0,0,0"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style x:Key="ToolBarWithoutOverflowBarStyle" TargetType="{x:Type ToolBar}">
            <Setter Property="Background" Value="{StaticResource ToolBarHorizontalBackground}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToolBar}">
                        <Grid x:Name="Grid" Margin="3,1,1,1" SnapsToDevicePixels="true">
                            <Grid x:Name="OverflowGrid" HorizontalAlignment="Right" Visibility="Hidden">
                                <ToggleButton x:Name="OverflowButton" ClickMode="Press" FocusVisualStyle="{x:Null}" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" Style="{StaticResource ToolBarHorizontalOverflowButtonStyle}"/>
                                <Popup x:Name="OverflowPopup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom" StaysOpen="false">

                                </Popup>
                            </Grid>
                            <Border x:Name="MainPanelBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Style="{StaticResource ToolBarMainPanelBorderStyle}" Margin="0">
                                <DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
                                    <Thumb x:Name="ToolBarThumb" Margin="-3,-1,0,0" Padding="6,5,1,6" Style="{StaticResource ToolBarThumbStyle}" Width="10"/>
                                    <ContentPresenter x:Name="ToolBarHeader" ContentSource="Header" HorizontalAlignment="Center" Margin="4,0,4,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
                                    <ToolBarPanel x:Name="PART_ToolBarPanel" IsItemsHost="true" Margin="0,1,2,2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                </DockPanel>
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsOverflowOpen" Value="true">
                                <Setter Property="IsEnabled" TargetName="ToolBarThumb" Value="false"/>
                            </Trigger>
                            <Trigger Property="Header" Value="{x:Null}">
                                <Setter Property="Visibility" TargetName="ToolBarHeader" Value="Collapsed"/>
                            </Trigger>
                            <Trigger Property="ToolBarTray.IsLocked" Value="true">
                                <Setter Property="Visibility" TargetName="ToolBarThumb" Value="Collapsed"/>
                            </Trigger>

                            <Trigger Property="Orientation" Value="Vertical">
                                <Setter Property="Margin" TargetName="Grid" Value="1,3,1,1"/>
                                <Setter Property="Style" TargetName="OverflowButton" Value="{StaticResource ToolBarVerticalOverflowButtonStyle}"/>
                                <Setter Property="Height" TargetName="ToolBarThumb" Value="10"/>
                                <Setter Property="Width" TargetName="ToolBarThumb" Value="Auto"/>
                                <Setter Property="Margin" TargetName="ToolBarThumb" Value="-1,-3,0,0"/>
                                <Setter Property="Padding" TargetName="ToolBarThumb" Value="5,6,6,1"/>
                                <Setter Property="Margin" TargetName="ToolBarHeader" Value="0,0,0,4"/>
                                <Setter Property="Margin" TargetName="PART_ToolBarPanel" Value="1,0,2,2"/>
                                <Setter Property="DockPanel.Dock" TargetName="ToolBarThumb" Value="Top"/>
                                <Setter Property="DockPanel.Dock" TargetName="ToolBarHeader" Value="Top"/>
                                <Setter Property="HorizontalAlignment" TargetName="OverflowGrid" Value="Stretch"/>
                                <Setter Property="VerticalAlignment" TargetName="OverflowGrid" Value="Bottom"/>
                                <Setter Property="Placement" TargetName="OverflowPopup" Value="Right"/>
                                <Setter Property="Margin" TargetName="MainPanelBorder" Value="0,0,0,11"/>
                                <Setter Property="Background" Value="{StaticResource ToolBarVerticalBackground}"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
                    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="FlatButton"
           TargetType="{x:Type ButtonBase}">
            <Setter Property="Background"
                Value="{DynamicResource FlatButtonHoverBackgroundBrush}" />
            <Setter Property="BorderBrush"
                Value="{DynamicResource FlatButtonHoverBorderBrush}" />
            <Setter Property="Foreground"
                Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
            <Setter Property="HorizontalContentAlignment"
                Value="Center" />
            <Setter Property="VerticalContentAlignment"
                Value="Center" />
            <Setter Property="Padding"
                Value="1" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ButtonBase}">
                        <Grid>
                            <Border x:Name="border"
                                Margin="0"
                                BorderThickness="1"
                                CornerRadius="2"
                                Background="Transparent"
                                BorderBrush="Transparent">
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Margin="{TemplateBinding Padding}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                              RecognizesAccessKey="True" />
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver"
                                 Value="True">
                                <Setter Property="Background"
                                    TargetName="border"
                                    Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Background}" />
                                <Setter Property="BorderBrush"
                                    TargetName="border"
                                    Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderBrush}" />
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused"
                                 Value="true" />
                            <Trigger Property="ToggleButton.IsChecked"
                                 Value="true" />
                            <Trigger Property="IsEnabled"
                                 Value="false">
                                <Setter Property="Foreground"
                                    Value="{DynamicResource FlatButtonDisabledForegroundBrush}" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Window.Resources>
    <DockPanel>
        <Grid Background="#FFCAE5D7" MinHeight="32"  VerticalAlignment="Top"   DockPanel.Dock="Top">
            <Grid.RowDefinitions>
                <RowDefinition ></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Grid Background="#FF04914C">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="465" />
                    <ColumnDefinition Width="402*" />
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Horizontal" Height="50" Grid.Column="0" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="2" Background="#2F869C">
                    <TextBlock Text="Dynamic CAD" VerticalAlignment="Center" Margin="15,0,5,0" FontSize="30" FontFamily="Calibri" Foreground="#CEF0D4" FontWeight="Bold"/>
                    <TextBlock Text="v0.5" VerticalAlignment="Center" Margin="5,0,35,0" FontSize="20" FontFamily="Calibri" Foreground="Yellow" FontStyle="Italic" />
                    <TextBlock VerticalAlignment="Center" Margin="10,0,0,0" Name="tbName" Text="{Binding Path=Name}" Foreground="White" />
                </StackPanel>
            </Grid>
            
        </Grid>
        <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" Grid.Column="3" Grid.Row="2" Grid.RowSpan="3" >
            <TextBlock Margin="10" HorizontalAlignment="Left">
                <Hyperlink Name="NewProject">Proje Yönetimi</Hyperlink>
            </TextBlock>
            <TextBlock  Margin="10" HorizontalAlignment="Left">
                        <Hyperlink Name="CreatePart">Parça Yönetimi</Hyperlink>
            </TextBlock>
            <TextBlock  Margin="10" HorizontalAlignment="Left">
                        <Hyperlink Name="CreateTemplate">Şablon Yönetimi</Hyperlink>
            </TextBlock>
            <TextBlock Margin="10" HorizontalAlignment="Left" Visibility="Hidden">
                        <Hyperlink Name="CreateNewPart">Yeni Parça Görünümü Tasarla</Hyperlink>
            </TextBlock>
        </StackPanel>
    </DockPanel>
</Window>
